package com.study.mythread.model;

/**
 * @program: java-study-of-learner
 * @description: 继承Thread
 * @author: future
 * @create: 2021-01-16 18:55
 **/
public class MyThread  extends Thread{
    //继承Thread主要获得线程的start

    public void run() {
        int i = 0;
        for(;;){
            System.out.println(Thread.currentThread().getName()+" 添加成员 "+i ++);
            if(i== 20){
                break;
            }
        }
    }

    public static void main(String[] args) {
        MyThread thread = new MyThread();
        thread.start();
        MyThread th2= new MyThread();
        th2.start();
    }

}
